package nc;
import java.util.*;
import org.junit.*;

import util.ListNode;

public class Qiuzhao {
    
    static class Main2 {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            sc.close();

            if (s.isEmpty()) {
                System.out.println("");
                return;
            }

            List<String> res = new ArrayList<>();

            char[] cs = s.toCharArray();
            int n = cs.length;
 
            if (isBig(cs[0])) {
                //首字母大写
                int start = 0;
                cs[0] = (char)('a' + cs[0] - 'A');

                for (int i = 1; i < n; i++) {
                    if (isBig(cs[i])) {
                        //转为小写
                        cs[i] = (char)('a' + cs[i] - 'A');
                        res.add(new String(cs, start, i - start));
                        start = i;

                    }
                }
                res.add(new String(cs, start, n - start));

            } else if (s.contains("_")) {
                String[] ss = s.split("_");
                for (String str: ss) {
                    res.add(str);
                }
            } else if (s.contains("-")) {
                String[] ss = s.split("-");
                for (String str: ss) {
                    res.add(str);
                }
            } else {
                //驼峰
                int start = 0;
                for (int i = 0; i < n; i++) {
                    if (isBig(cs[i])) {
                         //转为小写
                         cs[i] = (char)('a' + cs[i] - 'A');
                        res.add(new String(cs, start, i - start));
                        start = i;
                    }
                }
                res.add(new String(cs, start, n - start));
            }

            String[] ans = new String[4];
            Arrays.fill(ans, "");

            for (String tmp: res) {
                ans[2] += tmp + "_";
                ans[3] += tmp + "-";
                char[] cur = tmp.toCharArray();
                cur[0] = (char)(cur[0] - 'a' + 'A');
                String str = new String(cur);
                ans[0] += str;
                ans[1] += str;
            }
            cs = ans[1].toCharArray();
            cs[0] = (char)(cs[0] - 'A' + 'a');
            ans[1] = new String(cs);

            ans[2] = ans[2].substring(0, ans[2].length() - 1);
            ans[3] = ans[3].substring(0, ans[3].length() - 1);

            for (int i = 0; i < 4; i++) {
                System.out.print(ans[i] + " ");
            }
        }
    }

    private static boolean isBig(char c) {
        return c >= 'A' && c <= 'Z';
    }

    public String computeString (String str) {
        char[] cs = str.toCharArray();
        int n = cs.length;

        String[] strs = new String[n];
        Stack<Integer> nums = new Stack<>();
        int idx = -1;

        for (char c: cs) {
            if (c == '*') {
                //取出前面的数字
                int num = 0;
                int d = 1;
                while (idx >= 0 && strs[idx].matches("^[0-9]$")) {
                    //取出栈顶所有的单个数字
                    int t = Integer.parseInt(strs[idx--]);
                    num += (t * d);
                    d *= 10;
                }
                nums.push(num);
            } else if (c == ']') {
                //进行一轮运算
                StringBuilder sb = new StringBuilder();
                while (!"[".equals(strs[idx])) {
                    sb.insert(0, strs[idx--]);
                }
                idx--; //[出栈

                int num = nums.pop();
                String tmp = sb.toString();

                for (int i = 1; i < num; i++) {
                    sb.append(tmp);
                }

                //重新加入到栈顶
                strs[++idx] = sb.toString();
            } else {
                //普通字符、数字和[直接入栈
                strs[++idx] = String.valueOf(c);
            }
        }
        
        StringBuilder sb = new StringBuilder();
        while (idx >= 0) {
            sb.insert(0, strs[idx--]);
        }
        
        return sb.toString();
    }

    @Test
    public void test() {
        System.out.println(computeString("3*[a2*[c]]"));
    }

    static class Main {

        private static List<Integer> res;
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            String s = sc.nextLine();
            sc.close();

            String[] ss = s.split(" ");
            int n = ss.length;
            int[] nums = new int[n];
            res = new ArrayList<>();

            for (int i = 0; i < n; i++) {
                nums[i] = Integer.parseInt(ss[i]);
            }

            dfs(nums, 1, n - 1);
            for (int r: res) {
                System.out.print(r + " ");
            }
        }

        private static void dfs(int[] nums, int left, int right) {
            if (left == right) {
                res.add(nums[left]);
                return;
            } else if (left > right) {
                return;
            }
            int root = nums[left];
            //找到右子树的起点
            int rightStart = left + 1;
            for (int i = rightStart; i <= right; i++) {
                if (nums[i] > root) {
                    rightStart = i;
                    break;
                }
            }
            dfs(nums, left + 1, rightStart - 1);
            dfs(nums, rightStart, right);
        }
    }


    public boolean checkValidString (String s) {
        char[] cs = s.toCharArray();
        int n = cs.length;

        int[] left = new int[n], star = new int[n];
        int li = -1, si = -1;

        for (int i = 0; i < n; i++) {
            if (cs[i] == '(') {
                left[++li] = i;
            } else if (cs[i] == '*') {
                star[++si] = i;
            } else {
                if (li >= 0) {
                    li--;
                } else if (si >= 0) {
                    si--;
                } else {
                    return false;
                }
            }
        }

        while (li >= 0) {
            if (si < 0 || star[si] < left[si]) {
                return false;
            }
            si--;
            li--;
        }
        return true;
    }

    public ListNode reverseLinkedList (ListNode head, int n) {
        if (n == 1) {
            //保证翻转1个以上
            return reverse(head);
        }
        ListNode res = new ListNode(0), result = res;
        res.next = head;
        ListNode pre, post;

        while (head != null) {
            pre = findNextHead(head, n);
            post = pre.next;
            pre.next = null;

            //翻转当前这段
            pre = reverse(head);
            res.next = pre;
            
            head.next = post;
            res = head;
            head = head.next;
        }

        return result.next;
    }
    
    //翻转链表
    private ListNode reverse(ListNode head) {
        ListNode pre = null, post = head;
        while (post != null) {
            ListNode tmp = post.next;
            post.next = pre;
            pre = post;
            post = tmp;
        }
        return pre;
    }

    //找到下一截翻转起点 //并与前一段切断
    private ListNode findNextHead(ListNode head, int k) {
        ListNode pre = null;

        while (head != null && k > 0) {
            pre = head;
            head = head.next;
            k--;
        }

        // pre.next = null;

        return pre;
    }

    @Test
    public void test2() {
        int[] nums = new int[]{1,2,3,4,5,6,7,8};
        ListNode head = ListNode.newListNodeFromArray(nums);
        System.out.println(reverseLinkedList(head, 3));
    }

}
